define(['angular', 'app', 'ngUiRouter', 'app.services','services/common/base'], function (angular, app,service) {

    'use strict';

    app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {

        app.loadJs = function(js){
            return function($rootScope, $q){
                var def = $q.defer(), deps=[];
                angular.isArray(js) ? (deps = js) : deps.push(js);
                require(deps,function(){
                    $rootScope.$apply(function(){
                        def.resolve();
                    });
                });
                return def.promise;
            };
        };

            $urlRouterProvider.otherwise(function(){
                return "/index"
            });
            /**
             * 基础路由
             */
            $stateProvider.state("index", {
                    url: "/index",
                    templateUrl: "/app/partial/hss/index.html"
            });

    }]);
});